
import * as api from '@/api/home/department.js'
export default {
    namespaced: true,
    state: {
        deparmentList: []
    },
    mutations: {
        set_Department(state, value) {
            state.deparmentList = value
        }
    },
    actions: {
        async getDepartmentList(context) {
            await api.getDepartment()
                .then((res) => {
                    // console.log(res)
                    context.commit('set_Department', res.data.data.depts)
                })
                .catch((err) => {
                    // console.dir(err)
                    this.$message({
                        type: 'info',
                        message: '请求出错!'
                    })
                })
        }
    }
}